package jpf.nextsearch.util.validation.validator;

import jpf.nextsearch.util.validation.base.GenericValidator;

/**
 * @author <a href="mailto:jacek.pruszkowski@gmail.com">Jacek Pruszkowski</a>
 */
public class LongNumberValidator extends GenericValidator {

	@Override
	protected boolean isValueValidInternal(Object value) {
		String val = (String) value;
		try {
			Long.parseLong(val);
		} catch (NumberFormatException e) {
			return false;
		}
		return true;
	}
	
	@Override
	protected boolean supports(Class<?> klass) {
		return klass.isAssignableFrom(String.class);
	}
}
